<script>
  export default {
    name: 'authredirect',
    data() {
      return {
        loginForm: {
          account: this.$route.query.account,
          password: this.$route.query.password
        }
      }
    },
    created() {
      this.$store.dispatch('LoginByaccount', this.loginForm).then((res) => {
      // debugger
        if (res.code === 0) { // 返回的code为0，则表示登录成功，跳转页面
          location.href = '/'
        }
      }).catch(res => {
        this.$message.error(res.content)
      })
      // const hash = window.location.search.slice(1)
      // window.opener.location.href = window.location.origin + '/login#' + hash
      // window.close()
    }
  }
</script>
